package cn.com.mall.product.entity;

import cn.com.mall.common.valid.AddGroup;
import cn.com.mall.common.valid.ListValue;
import cn.com.mall.common.valid.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 品牌
 * 
 * @author yangwen
 * @email yangwen@servyou.com.cn
 * @date 2020-04-09 23:52:34
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "id必须传递",groups = {UpdateGroup.class})
	@Null(message = "新增时不能指定id",groups = {AddGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "名字不能为空！",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotBlank
	@ListValue(values = {0,1},groups =AddGroup.class )
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotNull(message = "不能为空",groups = {AddGroup.class,UpdateGroup.class})
	@Pattern(regexp="/^[a-zA-Z]$/",message = "首字母必须a-z或者A-Z之间")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "不能为空",groups = {AddGroup.class,UpdateGroup.class})
	@Min(value=0,message = "sort字段必须大于等于0",groups = {AddGroup.class,UpdateGroup.class})
	private Integer sort;

	public Long getBrandId() {
		return brandId;
	}

	public void setBrandId(Long brandId) {
		this.brandId = brandId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}

	public Integer getShowStatus() {
		return showStatus;
	}

	public void setShowStatus(Integer showStatus) {
		this.showStatus = showStatus;
	}

	public String getFirstLetter() {
		return firstLetter;
	}

	public void setFirstLetter(String firstLetter) {
		this.firstLetter = firstLetter;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
}
